package com.timeDeal.servlet;



import com.timeDeal.bean.ShijianchushouBean;
import com.timeDeal.service.ShijianchusouService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 叼爸爸 on 2016/9/9.
 */
public class ShijianChushouGuanliServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String  currentpage = request.getParameter("currentpage") ;
        ShijianchusouService shjianservice =new  ShijianchusouService();
        List<ShijianchushouBean>  result= new ArrayList<>() ;
        result = shjianservice.getAllXuqiuByZhuangtai("待审核",Integer.valueOf(currentpage));
        String   max = shjianservice.getCountByZhuangtai("待审核") ;
        request.setAttribute("result", result);
        request.setAttribute("max", max);
        for (ShijianchushouBean s:result) {
            System.out.println(s.getShijianchushoumingcheng());
        }
        request.setAttribute("currentpage",currentpage);
        request.getRequestDispatcher("/admin/shijianchuli.jsp").forward(request,response);





    }
}